package com.pptv.schedule;

import org.apache.curator.framework.CuratorFramework;

import com.pptv.ads.core.model.Node;
import com.pptv.schedule.callback.Callback;
import com.pptv.schedule.connector.ServerConnector;
import com.pptv.schedule.job.AdsJobTracker;
import com.pptv.schedule.job.JobHandler;

public class Context {

	private String rootPath;

	private AdsJobTracker jobTracker;

	private CuratorFramework client;

	private ServerConnector clusterConnector;

	private ServerConnector clientConnector;

	private boolean isLeader;

	private Callback callback;

	private Node node;

	private JobHandler handler;
	
	private static Context context = new Context();
	
	private Context(){
		
	}
	
	public static Context getInstance(){
		return context;
	}
	
	public AdsJobTracker getJobTracker() {
		return jobTracker;
	}

	public void setJobTracker(AdsJobTracker jobTracker) {
		this.jobTracker = jobTracker;
	}

	public CuratorFramework getClient() {
		return client;
	}

	public void setClient(CuratorFramework client) {
		this.client = client;
	}


	public ServerConnector getClusterConnector() {
		return clusterConnector;
	}

	public void setClusterConnector(ServerConnector clusterConnector) {
		this.clusterConnector = clusterConnector;
	}

	public ServerConnector getClientConnector() {
		return clientConnector;
	}

	public void setClientConnector(ServerConnector clientConnector) {
		this.clientConnector = clientConnector;
	}

	public boolean isLeader() {
		return isLeader;
	}

	public void setLeader(boolean isLeader) {
		this.isLeader = isLeader;
	}

	public Callback getCallback() {
		return callback;
	}

	public void setCallback(Callback callback) {
		this.callback = callback;
	}

	public String getRootPath() {
		return rootPath;
	}

	public void setRootPath(String rootPath) {
		this.rootPath = rootPath;
	}

	public Node getNode() {
		return node;
	}

	public void setNode(Node node) {
		this.node = node;
	}

	public JobHandler getHandler() {
		return handler;
	}

	public void setHandler(JobHandler handler) {
		this.handler = handler;
	}

}
